package com.spzx.product.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.web.domain.BaseEntity;

import java.io.Serial;
import java.math.BigDecimal;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

/**
 * <p>
 * 商品sku
 * </p>
 *
 * @author Haoran Sun
 * @since 2024-07-15
 */
@Getter
@Setter
@TableName("product_sku")
@Schema(description = "商品sku")
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class ProductSku extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "商品编号")
    @TableField("sku_code")
    private String skuCode;

    @TableField("sku_name")
    @Schema(description = "sku名称")
    private String skuName;

    @Schema(description = "商品ID")
    @TableField("product_id")
    private Long productId;

    @Schema(description = "缩略图路径")
    @TableField("thumb_img")
    private String thumbImg;

    @Schema(description = "售价")
    @TableField("sale_price")
    private BigDecimal salePrice;

    @Schema(description = "市场价")
    @TableField("market_price")
    private BigDecimal marketPrice;

    @Schema(description = "成本价")
    @TableField("cost_price")
    private BigDecimal costPrice;

    @Schema(description = "sku规格信息json")
    @TableField("sku_spec")
    private String skuSpec;

    @Schema(description = "重量")
    @TableField("weight")
    private BigDecimal weight;

    @Schema(description = "体积")
    @TableField("volume")
    private BigDecimal volume;

    @Schema(description = "线上状态：0-初始值，1-上架，-1-自主下架")
    @TableField("status")
    private Byte status;
    /**
     * 库存数量
     */
    @Schema(description = "sku库存")
    @TableField(exist = false)
    private Integer stockNum;

    @Schema(description ="sku销量")
    @TableField(exist =false)
    private Integer saleNum;
}
